#include <stdio.h>
#include<stdlib.h> 
#include<string.h>
int main()
{
	FILE *fp;
	int empty=0,note=0,code=0,line=0,i,j;
	char ch,input[10],str;
	if((fp=fopen("D:\\test.txt","r"))==NULL)
	{
		printf("这是个错误文件\n");
		return 0;
	}
	while(!feof(fp))
    {
        ch=fgetc(fp);

        if(str=='\n'&&ch=='\n')
			empty++; 
	
		if(str=='/'&&ch=='/')
            note++;
    	str=ch;
	}
	while(1)
	{
		printf("wc.exe-");
        scanf("%s",&input);
        if(input[0]=='e')
    	printf("文本空行总数%d\n",empty);
    	if(input[0]=='n')
    	printf("文本注释总数%d\n",note);
	}
	fclose(fp);
	return 0;
}